/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package util;

import java.util.ResourceBundle;

/**
 *
 * @author Sergey_Stefoglo
 */
public class MessageManager {
                private static MessageManager instance;
                private ResourceBundle resourceBundle;
//класс извлекает информацию из файла messages. properties
                private static final String BUNDLE_NAME = "add.message";


                public static MessageManager getInstance() {
                                if (instance == null) {
                                instance = new MessageManager();
                                instance.resourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
                                }
                                return instance;
                }
                public String getProperty(MessageEnum key) {
                                return resourceBundle.getString(key.name());
                }
}
